﻿using System;
using System.Collections.Generic;

namespace NLUNZ.Business
{

    public class TrackingItem
    {

        public string TIDeliveryNumber { get; set; }

        public string TIDeliveryCity { get; set; }

        public string TICustom { get; set; }


        #region Received - recipient pickup goods
        private string _recipient;

        public string TIPickupBy
        {
            get { return String.Format("取货员 <b>{0}</b> 取货", _recipient); }
            set { _recipient = value; }
        }
        public DateTime PickupDateTime { get; set; } //receiveddate and receivedtime
        #endregion

        #region Inventory - goods arrive warehouse
        public string InventoryDescription = "货件到达仓库";
        public DateTime InventoryDateTime { get; set; } //inventorydate and inventorytime

        #endregion

        #region Arrival departure Airport
        public string ArrivalDepartureAirportDescription = "货件到达货运机场";
        public DateTime ArrivalDepartureAirportDateTime { get; set; } //airportdate and airporttime
        #endregion

        #region Left departure City, heading destination country custom
        public string DeliveryToDestinationCountryCustom
        {
            get
            {
                string output = string.Format("快件已离开 <b>{0}</b>, 正前往 <b>{1}</b>", TIDeliveryCity, TICustom);
                return output;
            }
        }
        public DateTime DeliveryToDestinationCountryCustomDateTime { get; set; } //deliverydate and deliverytime
        #endregion

        #region arrival destination custom, awaiting custom clear
        //add 36 hours for arrival custom date
        public string ArrivalDestinationCountryCustom
        {
            get
            {
                string output = string.Format("快件已到达 <b>{0}</b>, 正在办理清关手续", TICustom);
                return output;
            }
        }

        private DateTime _arriveCustomDateTime = DateTime.MinValue;
        public DateTime ArrivalDestinationCountryCustomDateTime
        {
            get
            {
                if (DeliveryToDestinationCountryCustomDateTime != DateTime.MinValue)
                    _arriveCustomDateTime = DeliveryToDestinationCountryCustomDateTime.AddHours(36);
                return _arriveCustomDateTime;
            }
        }

        #endregion

        #region leave destination country custom, heading courier company
        //leave custom date
        public string ClearCustom
        {
            get
            {
                string output = string.Format("快件已离开 <b>{0}</b>, 正前往快递公司", TICustom);
                return output;
            }
        }
        public DateTime ClearCustomDateTime { get; set; }
        #endregion

        #region Arrive courier company

        public List<CourierTracking> CourierTrackings { get; set; }

        #endregion
    }
}